<?php

namespace App\Http\Controllers;

use App\Admin;
use Illuminate\Http\Request;

class UserController extends Controller
{
   public function login(Request  $request){
       $params = $request->input();
       $data = Admin::where('phone',$params['phone'])->orWhere('email', $params['phone'])->get();
       $array = json_decode(json_encode($data),true);;
       if (count($array) ==0){
           return ['code'=>300,'msg'=>'用户不存在','data'=>''];
       }else{
           return ['code'=>200,'msg'=>'进行密码验证','data'=>$array];
       }
   }
}
